/**
 * Copyright (C) 2017 - 2020 https://github.com/joewee
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bifrost.entity;

import javax.persistence.*;
import java.util.Date;

/**
 * @author joewee
 * @version 1.0.0
 * @Date 2017/12/3 21:35
 */
@Entity
@Table(name = "REFUND_REQUEST")
@NamedQuery(name = "RefundRequest.findAll", query = "SELECT p FROM RefundRequest p")
public class RefundRequest {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "REQUEST_ID")
    private Long refundRequestId;

    @Column(name = "OUT_TRADE_NUMBER", length = 64)
    private String outTradeNumber;

    @Column(name = "REFUND_NUMBER", length = 64)
    private String refundNumber;
    @Column(name = "ORDER_TOTAL_FEE")
    private Integer orderTotalFee;
    @Column(name = "REFUND_FEE")

    private Integer refundFee;
    @Column(name = "PAYMENT_ID")
    private Long paymentId;

    @Column(name = "REFUND_DESCRIPTION")
    private String refundDesc;
    @Lob
    @Column(name = "RESPONSE")
    private String response;

    @Column(name = "SUCCESS")
    private Boolean isSuccess = Boolean.FALSE;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "TIMESTAMP")
    private Date timestamp;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "UPDATE_TIMESTAMP")
    private Date updateTimestamp;

    @Column(name = "ORDER_ID")
    private Long orderId;

    @Column(name = "RETURN_ID")
    private Long returnId;

    /**
     * 是否为订单产生的退款申请如未发货的退款申请
     */
    @Column(name = "IS_FROM_ORDER")
    private Boolean fromOrder = Boolean.FALSE;

    public Long getRefundRequestId() {
        return refundRequestId;
    }

    public void setRefundRequestId(Long refundRequestId) {
        this.refundRequestId = refundRequestId;
    }

    public String getOutTradeNumber() {
        return outTradeNumber;
    }

    public void setOutTradeNumber(String outTradeNumber) {
        this.outTradeNumber = outTradeNumber;
    }

    public String getRefundNumber() {
        return refundNumber;
    }

    public void setRefundNumber(String refundNumber) {
        this.refundNumber = refundNumber;
    }

    public Integer getOrderTotalFee() {
        return orderTotalFee;
    }

    public void setOrderTotalFee(Integer orderTotalFee) {
        this.orderTotalFee = orderTotalFee;
    }

    public Integer getRefundFee() {
        return refundFee;
    }

    public void setRefundFee(Integer refundFee) {
        this.refundFee = refundFee;
    }

    public Long getPaymentId() {
        return paymentId;
    }

    public void setPaymentId(Long paymentId) {
        this.paymentId = paymentId;
    }

    public String getRefundDesc() {
        return refundDesc;
    }

    public void setRefundDesc(String refundDesc) {
        this.refundDesc = refundDesc;
    }

    public String getResponse() {
        return response;
    }

    public void setResponse(String response) {
        this.response = response;
    }

    public Boolean isSuccess() {
        return isSuccess;
    }

    public void setSuccess(Boolean success) {
        isSuccess = success;
    }

    public Date getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Date timestamp) {
        this.timestamp = timestamp;
    }

    public Date getUpdateTimestamp() {
        return updateTimestamp;
    }

    public void setUpdateTimestamp(Date updateTimestamp) {
        this.updateTimestamp = updateTimestamp;
    }

    public Boolean getSuccess() {
        return isSuccess;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Long getReturnId() {
        return returnId;
    }

    public void setReturnId(Long returnId) {
        this.returnId = returnId;
    }

    public Boolean isFromOrder() {
        return fromOrder;
    }

    public void setFromOrder(Boolean fromOrder) {
        this.fromOrder = fromOrder;
    }
}
